import bisect
from collections import Counter
import matplotlib.pyplot as plt
import numpy as np

init = 1602791666.499339
data = []
gdata = []
stpes = [init]
for line in open('fpm-init.log'):
    data.append(float(line.split(' - ')[1]) - init)

x = data
n = np.arange(1, len(x) + 1) / np.float(len(x))
Xs = np.sort(x)

# plt.figure()
fig, ax = plt.subplots(figsize=(6, 4))
ax.step(Xs, n)

ax.grid(True)
ax.legend(loc='right')
ax.set_title('CDF ospf init')
ax.set_xlabel('Time(s)')
plt.savefig('%s.png' % "init-cdf")
plt.show()
